<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    用户名： <input type="text" /> <br />
    密码：<input type="password" /> <br />
    性别：男<input type="radio" value="男" name="gender" /> 女
    <input type="radio" value="女" name="gender" /> <br />
    爱好：篮球<input type="checkbox" /> 足球 <input type="checkbox" />
    <hr />
    <button type="button" class="start">启用</button>
    <button type="button" class="stop">禁用</button>
    <script>
      window.onload = function () {
        document.querySelector(".start").onclick = function () {
          document.querySelectorAll("input").forEach(function (item) {
            item.disabled = false;
          });
        };
        document.querySelector(".stop").onclick = function () {
          document.querySelectorAll("input").forEach(function (item) {
            item.disabled = true;
          });
        };
      };
    </script>
  </body>
</html>
